// GameServer.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "MuEmulator.h"
#include "Interface.h"
#include "EmulatorController.h"

using namespace Interface;

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);

/*
 	Next::Objects::CMuPlayer* p1 = new Next::Objects::CMuPlayer();
 	Next::Objects::CMuPlayer* p2 = new Next::Objects::CMuPlayer();

	p1->SetIndex(0);
	p1->SetName("Rodrigo");
	p1->SetAccountName("Rodrigoo");
	p2->SetIndex(1);
	p2->SetName("Teste");
	p2->SetAccountName("Testee");
// 
// 	unsigned long x = p1->GetExp(2);
// 	unsigned long y = p2->GetExp(0);

	std::map<int, Next::Objects::CMuObject*> map;

	Next::GameServer::Objects::CMuPlayer::CreateExpTable();

	map.insert(make_pair(p1->Index(), p1));
	map.insert(make_pair(p2->Index(), p2));


	Next::Objects::CMuPlayer* pp = static_cast<Next::Objects::CMuPlayer*>(map[0]);
	Next::Objects::CMuPlayer* ppp = static_cast<Next::Objects::CMuPlayer*>(map[1]);
	

	Next::GameServer::Factorys::CMuObjectFactory* objectFactory = new Next::GameServer::Factorys::CMuObjectFactory();

	Next::GameServer::Objects::CMuPlayer* player = (Next::GameServer::Objects::CMuPlayer*)objectFactory->CreateObject(Next::GameServer::Defines::Player);
	Next::GameServer::Objects::CMuMonster* monster = (Next::GameServer::Objects::CMuMonster*)objectFactory->CreateObject(Next::GameServer::Defines::Monster);
	Next::GameServer::Objects::CMuNpc* npc = (Next::GameServer::Objects::CMuNpc*)objectFactory->CreateObject(Next::GameServer::Defines::Npc);
*/

	//Controllers::CEmulatorController* emuController = new Controllers::CEmulatorController();
	//emuController->AddObserver(gEmuInterface);
	//gEmuInterface->AddObserver(emuController);

	return CInterface::Instance()->Run(hInstance, nCmdShow);
}
